package cn.edu.jxyy.batistest.test;

import cn.edu.jxyy.batistest.mapper.StudentMapper;
import cn.edu.jxyy.batistest.pojo.Student;
import cn.edu.jxyy.batistest.utils.MyBatisUtils;
import org.apache.ibatis.session.SqlSession;

public class Part12_UpdateStudent {
    public static void main(String[] args) {
        SqlSession sqlSession = MyBatisUtils.getSession();
        StudentMapper studentMapper = sqlSession.getMapper(StudentMapper.class);
        Student student = new Student();
        student.setId(1);
        student.setName("小明");
        student.setAge(18);
        studentMapper.updateStudent(student);
        sqlSession.commit();
        sqlSession.close();
    }
}
